<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php
/**
 * Template for filter items block
 *
 * @var $block \Magento\LayeredNavigation\Block\Navigation\FilterRenderer
 */
?>

<ol class="items">
    <?php foreach ($filterItems as $filterItem): ?>
        <li class="item">
            <?php if ($filterItem->getCount() > 0): ?>
                <a href="<?php echo $block->escapeUrl($filterItem->getUrl()) ?>">
                    <?php /* @escapeNotVerified */ echo $filterItem->getLabel() ?>
                    <?php if ($this->helper('\Magento\Catalog\Helper\Data')->shouldDisplayProductCountOnLayer()): ?>
                        <span class="count"><?php /* @escapeNotVerified */ echo $filterItem->getCount()?><span class="filter-count-label">
                            <?php if ($filterItem->getCount() == 1):?> <?php /* @escapeNotVerified */ echo __('item')?><?php else:?> <?php /* @escapeNotVerified */ echo __('items') ?><?php endif;?></span></span>
                    <?php endif; ?>
                </a>
            <?php else:?>
                <?php /* @escapeNotVerified */ echo $filterItem->getLabel() ?>
                <?php if ($this->helper('\Magento\Catalog\Helper\Data')->shouldDisplayProductCountOnLayer()): ?>
                    <span class="count"><?php /* @escapeNotVerified */ echo $filterItem->getCount()?><span class="filter-count-label">
                        <?php if ($filterItem->getCount() == 1):?><?php /* @escapeNotVerified */ echo __('item')?><?php else:?><?php /* @escapeNotVerified */ echo __('items') ?><?php endif;?></span></span>
                <?php endif; ?>
            <?php endif; ?>
        </li>
    <?php endforeach ?>
</ol>
